Skip to content

feat(lint,viz,stats): see asset relations — lint counts, health view, opens via relation (#1562, stacked) - #1637

Merged
SaulMoro merged 9 commits into
Tencent:mainfrom
Walternater:feat-1562-asset-graph
Nov 2, 2026
Merged

SaulMoro merged 9 commits into
Tencent:mainfrom
Walternater:feat-1562-asset-graph

Conversation

@Walternater

@Walternater Walternater commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Implements all three parts of #1562: the team sees the relations as a whole, and whether sessions use them.

1. codebase --lint counts relations

Lint reads the member's own recall indexes as they are (project scope plus inherited user scope, mirroring recall), never a rebuild. New src/lint-asset-graph.ts holds one pure counter, computeLintAssetGraph, reused by part 2.

  • Assets: indexed rules, docs, learnings, skills. Teamwiki pages are targets, not assets.
  • relationCount: one count per relation line recall renders — each relation once per unordered asset pair, relation and via (a declared REFERENCES the target links back to counts twice: declared + link), links included, declared-beats-link by target, no 5-line cap. Relations to a teamwiki page count when the page exists and the codebase is not withheld — SaulMoro's re-check showed the acceptance arithmetic (4 relations on the [feat] Deepen a team's knowledge: relations across every asset, delivered to every tool, proved on the task bank #1552 example) is satisfiable only this way (rule MAPS_TO page + REFERENCES doc + skill + learning SUPERSEDES doc).
  • unresolved: declared targets naming nothing in the team clone on disk or the learnings roots — the same predicate contribute uses, so lint and contribute never disagree.
  • Text output gains one line after the report; --json gains assetGraph; without a teamwiki the line still prints with no new graph findings; with standalone --output there is no assetGraph and the output is unchanged; exit code unchanged. Help text names the counts and commands.md is regenerated.
Assets: 4, relations: 4, without a relation: 0, unresolved: 1

2. Relation counts in the knowledge-base health view

/kb-report and /api/context (built by src/viz.ts from the same index recall uses) show the same counts next to the silent list, each listing the assets behind it by team-tree path, labeled with the scope they were resolved for, plus the silent ∩ without-relation intersection ("the clearest candidate to link or to prune"). The view counts through computeLintAssetGraph — one implementation, so the view and --lint --json cannot drift.

Relations   4 assets · 4 relations · 0 without a relation · 1 unresolved
Silent and without a relation: none
Unresolved: rules/payments.md  REFERENCES  docs/payment-overview.md

3. Count the files a session opens from a relation

The recall run line gains, per doc, exactly the Related: paths recall printed (related: [{ relation, direction: out|in, path }], omitted when none); stdout is byte-identical. teamai stats gains the via relation column: a run counts once when the session opens any of its recorded related paths within the adoption window — same join, window and actor rules as adopted (#884), and votes stay exactly as defined there (opening a related path changes no vote, neither the hit's nor the related asset's). A pre-change log reads as before (via relation 0); --dry-run records nothing.

session   agent        runs  recalled  adopted  via relation
7c1e2a90  claude-code  2     6         2        1

Testing

  • npx tsc --noEmit, npm run lint, npm run build clean.
  • Unit: lint-asset-graph (14), viz relation counts incl. exact acceptance example and XSS escaping (7+), relatedRefsOf, 5 new acceptance tests in recall-attribution (run-line shape, once-per-run counting, votes untouched, outside-window 0, old-log compatibility); commands-reference regenerated.
  • Targeted suites green: viz dashboard-ui lint-asset-graph asset-relations relation-candidates recall-attribution codebase-reconcile commands-reference stats recall-adoption recall-log (271 + 43 tests) and the real-CLI relations-e2e (5 tests).
  • Part 1 verified against the built CLI on a scratch team repo: exact text line and assetGraph JSON, no-teamwiki and --output behaviors. Part 3 verified against the built CLI: run JSONL carries related, stats shows via relation flip 0→1 on an evidence read with adopted and all vote counts unchanged.
  • Full suite deferred until the stack settles to avoid rebase churn.

Refs #1562 (closes it once merged).


Review updates (SaulMoro re-checks): via-relation ambiguity pool keeps counted runs (skip on add only); the counting rule is stated in code and locked by a test; graphHealth is null ("not checked") when graph-index.json is missing or corrupt instead of reading as a measured 0% — in every mode, standalone --output included, and the type documents that scripts must handle null. The one new not-checked CLI line is English per AGENTS.md.

Rebased onto #1636's collectCodePages pool (head 135ee25f); the stacking note above is historical. If #1636 squash-merges first, one final --onto origin/main rebase drops its commits from this diff.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Keep derived edges scope-local — src/recall.ts:602: Every scope’s rule globs match the combined result pages, and edges retain no scope. With an inherited user rule and identically named wiki pages in both clones, a project page’s matching source: can cause recall to print a relation to the unrelated user page. Match and retain edges within their originating scope.

  • [P2 non-blocking] Apply declared-over-link precedence by target — src/lint-asset-graph.ts:79: The deduplication key includes the relation type. A learning declaring SUPERSEDES: docs/a.md and also linking to that document counts two relations, although recall suppresses the linked REFERENCES. Suppress links to declared targets before counting.

  • [P2 non-blocking] Check ambiguity per glob — src/recall.ts:604: Matches from all rule globs are combined before checking codebase ambiguity. If two globs each uniquely match a different codebase, both valid mappings disappear because the combined slug count is two. Check each glob independently, then union its unambiguous edges.

  • [P2 non-blocking] Preserve cross-run relative-path ambiguity checks — src/recall-adoption.ts:344: Related paths are matched separately for each run. If overlapping runs record /a/docs/setup.md and /b/docs/setup.md, a relative read of docs/setup.md counts both runs. Adoption checks uniqueness across all applicable runs and rejects this ambiguous read; use the same combined-path check here.

The PR description documents sufficient testing, including built-CLI verification and representative real-CLI results. No missing-testing finding. Nothing from the PR was run, built, or installed.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Reviewed the four commits beyond #1636 (5a844dfa...a7b0911b) against #1562, with the built CLI on an isolated home and a local team repo.

What holds:

  • The health view (/api/context, /kb-report) shows the same counts as codebase --lint --json.
  • The recall run line gains an optional related field; stats counts "via relation" 0 → 1 after a read of a Related: path; a log written by main reads on this build and the other way round.
  • The lint line is still printed without a teamwiki, and standalone --output is unchanged; exit codes match main.
  • check-docs passes; the English and Chinese knowledge pages agree.

Findings:

  • [P1 blocking] The acceptance line is not met. On [feat] Deepen a team's knowledge: relations across every asset, delivered to every tool, proved on the task bank #1552's example plus the typo, this head prints Assets: 4, relations: 3, without a relation: 0, unresolved: 1; [feat] See asset relations: lint counts, health view, and opens via relation #1562 asks for relations: 4. Recall prints four resolved relations on that fixture (the rule's MAPS_TO to the teamwiki page, its REFERENCES to the skill and to the doc, and the learning's SUPERSEDES), and src/lint-asset-graph.ts:77 skips the one whose target is a teamwiki page. The unit test reaches 4 because its fixture adds a REFERENCES to a learning that the example does not have. "Teamwiki pages are targets and are not counted" sits under Assets; counting a relation to a resolved page and leaving pages out of assetCount gives the issue's numbers. If pages are meant to stay out of relationCount, the issue's example has to change instead.
  • [P1 blocking] Lint and recall disagree on "declared beats link". Recall drops a link to any target that has a declared relation (src/recall.ts:510-513). Lint dedups by relation type (lint-asset-graph.ts:79-80, key from|relation|target), so a learning that declares SUPERSEDES docs/x.md and also links docs/x.md in its body counts 2 in lint and prints 1 in recall. Reproduced on the built CLI.
  • [P2 non-blocking] codebase --lint --json without a teamwiki prints only {"assetGraph": …}; with one it prints summary, issues, graphHealth and assetGraph. A script reading .summary gets nothing in the first case.
  • [P2 non-blocking] "via relation" matches a relative read against each run's related paths on its own (src/recall-adoption.ts:336,344), while adoption checks across the window's runs, so a relative docs/setup.md can count two runs from different roots. Read from the code, not reproduced.
  • [P3 nit] src/viz.ts:465,468 build a SearchIndex and a LocalConfig with as; a narrower parameter for buildRelationContext would avoid the casts.

@jeff-r2026 Your call once the count and the dedup match recall.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Filter derived-edge inputs by scope — src/recall.ts:615: Edges now have scope-local buckets, but every bucket still matches the combined result pages. With an inherited user rule and identically named wiki pages in both clones, a project page’s matching source: can still produce a relation to the unrelated user page. Filter pages by their originating scope before matching.

  • [P2 non-blocking] Apply declared-over-link precedence by target — src/lint-asset-graph.ts:79: A learning declaring SUPERSEDES: docs/a.md and also linking to that document counts two relations because the key includes the relation type. Recall suppresses the linked REFERENCES. Suppress links to declared targets before counting.

  • [P2 non-blocking] Check relative-path ambiguity across applicable runs — src/recall-adoption.ts:344: Overlapping runs recording /a/docs/setup.md and /b/docs/setup.md both count a relative read of docs/setup.md, because matching happens separately per run. Check uniqueness across all applicable runs before crediting either.

Resolved: The earlier per-glob ambiguity finding is fixed: each glob is checked independently before its edges are unioned.

Testing: The PR description documents sufficient testing, including built-CLI verification and representative real-CLI results. No missing-testing finding. Nothing from the PR was run, built, or installed.

Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
… full JSON shape, pooled ambiguity

Review on Tencent#1637:
- relationCount now includes a relation to a teamwiki page when the page
  exists and its codebase is not withheld — the issue's acceptance
  arithmetic (Tencent#1552's example plus the typo gives 4) holds only this
  way; pages stay out of assetCount and withoutRelation. The fixtures
  now use the true Tencent#1552 example.
- Lint applies declared-beats-link by target, the rule recall renders:
  a local link to an asset that also has a declared relation from the
  same entry is prose, not a second edge.
- --lint --json without a teamwiki prints the full report shape
  (summary, issues, graphHealth, assetGraph) so scripts reading
  .summary see the same structure either way.
- via relation pools every applicable run's related paths before the
  relative-path ambiguity check, the same way adoption pools docs: a
  relative read that could name a path in two runs' roots credits
  neither.
@Walternater
Walternater force-pushed the feat-1562-asset-graph branch from 44b1e98 to 8a584d3 Compare November 1, 2026 05:51
@Walternater

Copy link
Copy Markdown
Contributor Author

Review findings addressed in 8a584d3a:

  • Acceptance arithmetic — relationCount now includes a relation to a teamwiki page when the page exists and is not withheld; with the true [feat] Deepen a team's knowledge: relations across every asset, delivered to every tool, proved on the task bank #1552 example plus the typo, lint prints exactly relations: 4. Pages stay out of assetCount and withoutRelation. The fixtures now use the true example (the earlier variant had manufactured a REFERENCES to the learning). The health view counts through the same function, so the two stay in lockstep.
  • Declared beats link by target — lint suppresses a local link to any target that has a declared relation from the same entry, exactly what recall renders; new unit test.
  • --lint --json without a teamwiki now prints the full report shape (summary, issues, graphHealth, assetGraph) so scripts reading .summary see the same structure either way.
  • Relative-path ambiguity in via relation — related paths of every applicable run are pooled before the uniqueness check, the same pooling adoption uses for docs; a relative read that could name a path in two runs' roots credits neither. New regression test.

The page-scope filtering fix from #1636's 97af22ac is also ported into this branch's run-record path.

Verification: tsc / lint / build clean; 317 targeted unit tests + the 5-test real-CLI relations-e2e pass, incl. 50 lint/viz tests on the acceptance example.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Keep counted runs in the ambiguity pool — src/recall-adoption.ts:342: With overlapping runs recording /a/docs/setup.md and /b/docs/setup.md, an absolute read of the first path counts run A. A subsequent relative read of docs/setup.md then incorrectly counts B because A is excluded from the ambiguity check. Pool all window/actor-applicable runs; skip already-counted runs only when updating the count.

  • [P2 non-blocking] Deduplicate unordered relations independently of provenance — src/lint-asset-graph.ts:114: If A declares REFERENCES B and B links to A, the unordered pair counts twice because the final key includes via. This inflates both lint and health-view counts despite the once-per-unordered-pair contract. Omit provenance from the final deduplication key.

Resolved: The earlier scope-filtering, same-source declared-over-link precedence, and per-glob ambiguity findings are fixed. Cross-run ambiguity pooling is improved but remains incomplete as described above.

Testing: The description documents sufficient testing, including build and representative real-CLI verification. No missing-testing finding. Only the scoped diff was read; nothing from the PR was run, built, or installed.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Re-checked at 8a584d3a (commits beyond #1636's 97af22ac) with the built CLI on #1552's example plus the typo and on a declared-plus-link fixture.

Resolved:

  • The acceptance line now matches: Assets: 4, relations: 4, without a relation: 0, unresolved: 1, and --json assetGraph equals the issue's block.
  • Declared beats link by target: a learning that declares SUPERSEDES and links the same doc counts once, as recall prints it.
  • --lint --json without a teamwiki has the full report shape.

Still open:

  • [P2 non-blocking] "via relation" can still count a relative read for a second run. src/recall-adoption.ts:341 leaves runs already in viaRelationRuns out of applicable, so they also leave the pool the ambiguity check uses (line 348). An absolute read of run A's related path credits A; a later relative read that names a path in both A's and B's roots then sees only B and credits it: 2 where adoption would give 1. Reproduced on the built CLI. Pooling every in-window run's paths, and skipping already-counted runs only when adding, keeps the two checks the same.
  • [P2 non-blocking] A reciprocal pair counts twice. A rule that declares REFERENCES docs/payments-overview.md, with the doc linking back to the rule, gives relations: 4 where counting per pair gives 3; the key at src/lint-asset-graph.ts:114 includes via. [feat] See asset relations: lint counts, health view, and opens via relation #1562 says "each resolved relation counts once, not once per direction", which reads as 3, but recall prints both a declared and a linked line here, so "declared and link are two relations" is also a fair reading. Worth stating which one the count follows.
  • [P2 non-blocking] Without a teamwiki, --json fills summary with zeros and graphHealth with connectivity: 0, which reads as a measured 0% rather than "not checked".
  • [P3 nit] src/viz.ts still builds a SearchIndex and a LocalConfig with as.
  • [P3 nit] The intermediate commits 55a54883 and 727a11e1 carry src/recall.ts without feat(relations): derived rule-path edges and reconcile candidates (#1563) #1636's per-scope fix, which 8a584d3a restores; a squash merge makes this moot.

@jeff-r2026 Your call; the first two are the ones I would settle before merging.

Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
…ount rule, null graphHealth

Review on Tencent#1637:
- recall-adoption: the via-relation pool now keeps every in-window run
  (counted ones included); already-counted runs are skipped only when
  adding. An absolute read of run A's related path credits A, and a later
  relative read naming a path in both A's and B's roots sees both runs
  and credits neither — 1 where the old pool gave 2 (Tencent#1637 review),
  matching how adoption pools docs. Regression test added.
- lint-asset-graph: the counting comment states the reading the
  relationCount follows — one count per relation line recall renders, so
  a declared REFERENCES the target links back to counts twice — with a
  test locking it (Tencent#1637 review).
- codebase-wiki-lint: graphHealth is null when graph-index.json is
  missing or corrupt (and in the no-teamwiki --lint --json fallback),
  so a JSON reader sees "not checked" instead of a measured 0%.
  summary zeros stay: issues were checked, none found.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution
+ viz unit suites pass (192 tests).
@Walternater

Copy link
Copy Markdown
Contributor Author

All three P2s addressed at d36db48b.

[P2] via-relation pool drops counted runs. Fixed: the pool now keeps every in-window run — counted ones included — and only the adding loop skips already-counted runs. Your repro now gives 1: the absolute read credits A, the later relative read sees both A's and B's roots in the pool, reads as ambiguous, and credits no second run. Added a regression test that writes exactly that log.

[P2] Reciprocal pair counts twice. Stated, and locked with a test. The count follows what recall renders — one count per relation line — so a declared REFERENCES the target links back to is two relations (declared + link), not one per pair. The via stays in the counting key on purpose: recall prints both lines, so the lint number matching the printed graph is the reading that keeps --lint, the viz health view, and recall consistent with each other.

[P2] graphHealth zeros read as measured 0%. graphHealth is now null when graph-index.json is missing or corrupt (and in the no-teamwiki --lint --json fallback), so a JSON reader sees "not checked". summary zeros stay — issues were checked, none found. Human output prints 图谱: 未检查(graph-index.json 缺失或损坏) in that case.

[P3s]. The viz.ts as casts are worth a cleanup pass but not in this diff; the intermediate commits vanish on squash.

One heads-up for the merge order: this branch still carries the pre-fix version of #1636's computeDerivedRelations (results-based). Once #1636 lands I'll rebase onto main with --onto and fold the new codePages pool through — the recall-adoption and counting fixes here are independent of that and won't conflict.

Verified: tsc / lint / build clean; lint-asset-graph + recall-attribution + viz suites pass (192 tests) at this head.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Deduplicate unordered relations independently of provenance — src/lint-asset-graph.ts:117: A declaring REFERENCES B and B linking to A still count twice because the final key includes via. This contradicts the description’s once-per-unordered-pair contract and inflates lint and health-view counts. Remove provenance from the final key.

  • [P2 non-blocking] Align teamwiki-edge counting with the stated contract — src/lint-asset-graph.ts:97: A lone rule mapping to an existing, visible teamwiki page produces relationCount: 1, although the description explicitly excludes relations to teamwiki pages. Reconcile the implementation and acceptance tests with that contract.

  • [P2 non-blocking] Preserve standalone lint’s existing JSON shape — src/codebase-wiki-lint.ts:177: With --lint --output ... --json and no graph index, graphHealth changes from a metrics object to null; existing consumers accessing .graphHealth.nodeCount now fail. This also contradicts the stated unchanged standalone output.

  • [P2 non-blocking] Keep the new CLI message English — src/codebase-wiki-lint.ts:232: The newly added missing/corrupt-graph message is Chinese, violating the repository’s English CLI-output requirement. Translate this new message without expanding into unrelated existing strings.

Resolved: Scope filtering, per-glob ambiguity, same-source declared-over-link precedence, and cross-run ambiguity—including retaining already-counted runs—are fixed.

Testing: The description documents sufficient testing, including build and representative real-CLI verification. No missing-testing finding. Only the scoped diff was read; nothing from the PR was run, built, or installed.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Re-checked at d36db48b with the built CLI.

Resolved:

  • "via relation" no longer over-counts. With the same log, the absolute-then-relative read case counts 1 here and 2 on 8a584d3a.
  • The no-teamwiki --lint --json now reports graphHealth: null, so "not checked" no longer reads as a measured 0%.

Open:

  • [P1 blocking] src/codebase-wiki-lint.ts:232 adds a new Chinese CLI line, 图谱: 未检查(graph-index.json 缺失或损坏). AGENTS.md: "CLI user-facing output must be English. No Chinese in production code." The neighbouring 图谱: … 连通性 line predates this PR; the new one should be English.
  • [P2 non-blocking] The null also reaches standalone codebase --lint --output DIR --json when graph-index.json is missing; main printed zeros there, and the description says standalone output is unchanged. A script doing arithmetic on graphHealth.connectivity now gets null. Either keep it to the no-teamwiki fallback or say in the description that the field can be null.
  • [P3 nit] On the reciprocal pair, the reasoning (count follows what recall prints) is fine with me as the stated contract. Recall prints four Related: lines for one reciprocal pair (two on each hit) while lint counts 2, so "one count per line" is not literal either. The description still says "once per unordered asset pair" and that teamwiki relations "do not count", both of which the code no longer does; updating it to the rule the code follows would settle it for a reader.
  • [P3 nit] src/viz.ts as casts, unchanged.

This branch sits on #1636's 97af22ac; #1636 is now at b7fe124a, so it needs a rebase onto it before merging.

@jeff-r2026 Your call once the new line is in English.

@Walternater
Walternater force-pushed the feat-1562-asset-graph branch from d36db48 to 135ee25 Compare November 1, 2026 14:50
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
… full JSON shape, pooled ambiguity

Review on Tencent#1637:
- relationCount now includes a relation to a teamwiki page when the page
  exists and its codebase is not withheld — the issue's acceptance
  arithmetic (Tencent#1552's example plus the typo gives 4) holds only this
  way; pages stay out of assetCount and withoutRelation. The fixtures
  now use the true Tencent#1552 example.
- Lint applies declared-beats-link by target, the rule recall renders:
  a local link to an asset that also has a declared relation from the
  same entry is prose, not a second edge.
- --lint --json without a teamwiki prints the full report shape
  (summary, issues, graphHealth, assetGraph) so scripts reading
  .summary see the same structure either way.
- via relation pools every applicable run's related paths before the
  relative-path ambiguity check, the same way adoption pools docs: a
  relative read that could name a path in two runs' roots credits
  neither.
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
…ount rule, null graphHealth

Review on Tencent#1637:
- recall-adoption: the via-relation pool now keeps every in-window run
  (counted ones included); already-counted runs are skipped only when
  adding. An absolute read of run A's related path credits A, and a later
  relative read naming a path in both A's and B's roots sees both runs
  and credits neither — 1 where the old pool gave 2 (Tencent#1637 review),
  matching how adoption pools docs. Regression test added.
- lint-asset-graph: the counting comment states the reading the
  relationCount follows — one count per relation line recall renders, so
  a declared REFERENCES the target links back to counts twice — with a
  test locking it (Tencent#1637 review).
- codebase-wiki-lint: graphHealth is null when graph-index.json is
  missing or corrupt (and in the no-teamwiki --lint --json fallback),
  so a JSON reader sees "not checked" instead of a measured 0%.
  summary zeros stay: issues were checked, none found.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution
+ viz unit suites pass (192 tests).
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
…e onto Tencent#1636's page pool

Rebased onto Tencent#1636's collectCodePages pool; SaulMoro's re-check on Tencent#1637:
- codebase-wiki-lint prints the new not-checked line in English
  (AGENTS.md: no Chinese in CLI output).
- WikiLintReport documents that graphHealth can be null in every mode,
  standalone --output included: graph-index.json missing or corrupt means
  "not checked", never a measured 0%; scripts reading
  graphHealth.connectivity must handle null.
- formatResults delegates relation rendering to resultsRelations (which
  owns the derived-edge computation now); two leftovers from the rebase
  removed.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution +
viz + asset-relations (270 tests) and the 5 real-CLI relations-e2e pass.
@Walternater

Copy link
Copy Markdown
Contributor Author

Fixed and rebased at 135ee25f.

  • [P1] The new not-checked line is English: graph: not checked (graph-index.json missing or corrupt). (The neighbouring 图谱: … line predates this PR and I left it untouched to keep the diff surgical — happy to anglicize the whole file in a follow-up if wanted.)
  • [P2] Settled by documenting, per your second option: graphHealth is null in every mode when graph-index.json is missing or corrupt — standalone --output included — and WikiLintReport's comment now says so explicitly, so a script doing arithmetic on graphHealth.connectivity knows to handle null. Zeros were the misleading reading; "not checked" is the honest one in all modes.
  • [P3] Description updated to the rule the code follows ("one count per relation line recall renders … relation and via", page relations count when the page exists and the codebase isn't withheld). Fair note that "one count per line" isn't literal — the contract is per (pair, relation, via), which is what recall renders before its 5-line cap.
  • Rebased onto feat(relations): derived rule-path edges and reconcile candidates (#1563) #1636's collectCodePages pool as asked — computeDerivedRelations here is now the visible-page-pool version, and the stacking paragraph in the description is updated. One final --onto origin/main after feat(relations): derived rule-path edges and reconcile candidates (#1563) #1636 squash-merges will drop its commits from this diff.

Verified: tsc / lint / build clean; lint-asset-graph + recall-attribution + viz + asset-relations (270 tests) and the 5 real-CLI relations-e2e pass at this head.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Read at 135ee25f: the new line is English, the null contract is documented on WikiLintReport, the description states the count rule the code follows, and the branch sits on #1636's 4c08fb46. Nothing open from the last pass.

One thing for the rebase: #1653 has since put the rest of src/codebase-wiki-lint.ts into English on main, and this branch conflicts with it there. After the rebase, the heading reads Graph: … connectivity …, so Graph: not checked (graph-index.json missing or corrupt) would match it.

@jeff-r2026 Your call once it is rebased onto #1636 and main.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Include path-derived relations in the counter — src/lint-asset-graph.ts:72: Only entry.related is counted; ctx.ruleGlobs and ctx.codePages are ignored. A rule with paths: [src/ledger/**] matching one visible codebase prints MAPS_TO in recall, but lint and the health view report zero relations and list the rule as unrelated. Include derived edges with recall’s precedence rules.

  • [P2 non-blocking] Use the same scope/index inputs for health counts — src/viz.ts:475: The view counts only its single index, whereas lint includes inherited user scope. With one project rule and one unshadowed inherited user rule, lint reports two assets but the view reports one. The existing viz rebuild fallback also produces different counts when the saved index is missing. Sharing the counter alone does not prevent this drift.

  • [P2 non-blocking] Preserve standalone lint’s existing JSON shape — src/codebase-wiki-lint.ts:179: The earlier compatibility finding remains: --lint --output … --json without a graph index now returns graphHealth: null instead of a metrics object. Existing consumers accessing .graphHealth.nodeCount fail, despite the description’s unchanged-standalone-output promise.

Resolved: Scope filtering, per-glob ambiguity, declared-over-link precedence, cross-run ambiguity pooling, and the English-message finding are fixed. The provenance and teamwiki counting concerns are addressed by the revised contract and acceptance tests.

Testing: The description documents sufficient build and representative real-CLI verification; no missing-testing finding. Only the scoped diff was read. Nothing from the PR was run, built, or installed.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Count path-derived relations — src/lint-asset-graph.ts:72: The counter only reads entry.related, ignoring ctx.ruleGlobs and ctx.codePages. A rule with paths: [src/ledger/**] matching one visible codebase page prints MAPS_TO in recall, but lint and the health view report zero relations and list it as unrelated. Include derived edges with recall’s precedence rules.

  • [P2 non-blocking] Use matching scope/index inputs for health counts — src/viz.ts:475: The view counts one index, while lint includes inherited user scope. With one project rule and one unshadowed inherited user rule, lint reports two assets but the view reports one. The view’s index-rebuild fallback also differs from lint’s saved-index-only behavior. Sharing the counter does not ensure matching counts; align the inputs.

Resolved: Earlier scope isolation, per-glob ambiguity, declared-over-link precedence, cross-run ambiguity pooling, and English-output findings are fixed. Provenance/teamwiki counting and nullable graphHealth are now explicitly intentional under the revised contract.

Testing: The description documents sufficient build and representative real-CLI verification. No missing-testing finding. Only the scoped diff was read; nothing from the PR was run, built, or installed.

Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
…er lint's scope inputs

Codex review on Tencent#1637:
- computeLintAssetGraph now counts path-derived rule→page edges: each
  glob judged per codebase over the scope's code-page pool, a declared
  relation from the rule to the page beating the derived one — the same
  visibility and precedence recall renders. A scoped rule lint used to
  list as unrelated no longer does. Pages stay targets, not assets.
- memberScopeGraphs (extracted from lintAssetGraph) gives the viz health
  view the same saved indexes and scope selection codebase --lint uses,
  so the two cannot disagree about inputs (an inherited user scope
  counted twice before). A report without a member scope (--repo, the
  ~/.teamai fallback) still counts its own entries.

Verified: tsc, lint, build clean; lint-asset-graph + viz +
recall-attribution + asset-relations (254 tests) and the 5 real-CLI
relations-e2e pass.
@Walternater

Copy link
Copy Markdown
Contributor Author

Both P2s fixed at 58a0ce51.

[P2] Count path-derived relations. computeLintAssetGraph now counts derived rule→page edges: each glob is judged per codebase over the scope's own code-page pool, and a declared relation from the rule to the page beats the derived one — the same visibility and precedence recall renders (printedRelations). A rule with paths: [src/ledger/**] matching one visible page no longer shows relations: 0 / listed as unrelated while recall prints → MAPS_TO. The #1552 acceptance arithmetic is unchanged: there the rule's MAPS_TO to the page is declared, so it still counts once. Pages stay targets, not assets. Three tests cover the counted, ambiguous (two-codebase glob → none, as recall), and declared-beats-derived cases.

[P2] Matching scope/index inputs for the health view. memberScopeGraphs is extracted from lintAssetGraph (same saved-index-only reads, same project + inherited-user scope selection, same shadow filtering), and computeRelationStats counts through it whenever the report has a member scope — so the view and codebase --lint share both the counter and the inputs. A report without a member scope (--repo, the ~/.teamai fallback) still counts its own entries, as before.

Verified: tsc / lint / build clean; lint-asset-graph + viz + recall-attribution + asset-relations (254 tests) and the 5 real-CLI relations-e2e pass at this head.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
  • [P2 non-blocking] Resolve health counts from the supplied scope — src/viz.ts:464: paths.scope only gates the call; memberScopeGraphs independently detects the current directory’s config. Requesting a dashboard with project B’s explicit config while cwd belongs to project A therefore shows A’s relation counts alongside B’s entries and votes. Pass the resolved scope into the shared loader.

  • [P2 non-blocking] Include recalled paths in relative-read ambiguity checks — src/recall-adoption.ts:351: The ambiguity pool contains only related paths. If a run recalls /b/docs/setup.md with a relation to /a/docs/setup.md, reading docs/setup.md from B incorrectly increments via relation. Check uniqueness against both recalled and related paths before crediting a related open.

Resolved: The previous path-derived counting and health-input findings are fixed for ordinary cwd-selected reports. Earlier scope isolation, per-glob ambiguity, declared-over-link precedence, and counted-run ambiguity fixes remain present. The revised provenance/teamwiki and nullable-health contracts address their earlier findings.

Testing: The description documents sufficient build and representative real-CLI verification; no missing-testing finding. Only the scoped diff was read. Nothing from the PR was run, built, or installed.

Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 1, 2026
…led paths in the ambiguity check

Codex review on Tencent#1637:
- memberScopeGraphs accepts an already-resolved config and the viz health
  view passes paths.scope: a dashboard requested with project B's
  explicit config no longer shows project A's (cwd-detected) relation
  counts. An explicitly user-scoped config counts as the user scope and
  cannot inherit itself.
- The via-relation ambiguity pool now holds each run's recalled paths
  alongside its related paths: a relative read that could name one of
  each credits nothing — it is plausibly an ordinary read of the
  recalled doc the relation points away from. Regression test added.

Verified: tsc, lint, build clean; recall-attribution + lint-asset-graph
+ viz (223 tests) and the 5 real-CLI relations-e2e pass.
@Walternater

Copy link
Copy Markdown
Contributor Author

Both P2s fixed at 9024c850.

[P2] Resolve health counts from the supplied scope. memberScopeGraphs now accepts an already-resolved config, and the viz health view passes paths.scope — the dashboard's counts come from the scope it actually reports on, not a re-detection of the cwd. An explicitly user-scoped config counts as the user scope (and can't inherit itself, which the old shape would have double-counted).

[P2] Pool recalled paths in the ambiguity check. The via-relation pool now holds each run's recalled paths alongside its related paths; only the credit test stays related-only. Your scenario — run recalls /b/docs/setup.md with a relation to /a/docs/setup.md, then a relative read of docs/setup.md — now credits nothing: the read is plausibly the ordinary read of the recalled doc. Regression test added for exactly that log.

Verified: tsc / lint / build clean; recall-attribution + lint-asset-graph + viz (223 tests) and the 5 real-CLI relations-e2e pass at this head.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

No new findings in the scoped diff.

Resolved: Both latest findings are fixed: viz passes its resolved config into memberScopeGraphs, and relative-read ambiguity checks include recalled and related paths while retaining already-counted runs. Earlier fixes remain present; the revised contracts address the provenance/teamwiki counting and nullable graphHealth concerns.

Testing: The PR description documents sufficient build and representative real-CLI verification. No missing-testing finding.

Only the specified diff was read; nothing from the PR was run, built, or installed.

@SaulMoro

SaulMoro commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Re-checked at 9024c850 with the built CLI.

  • [feat] Deepen a team's knowledge: relations across every asset, delivered to every tool, proved on the task bank #1552's example plus the typo still prints Assets: 4, relations: 4, without a relation: 0, unresolved: 1, and --json assetGraph matches the issue's block.
  • A rule whose paths: glob matches one visible code page, with nothing declared, now counts in lint, and recall prints its → MAPS_TO. A glob that matches two codebases counts nothing.
  • The automated review's two points from 58a0ce51 reproduced there and are fixed here:
    • With the current directory in project A and project B's scope passed explicitly, the health view showed A's counts on 58a0ce51 and shows B's here.
    • A relative read that matches two recalled paths counted "via relation 1" on 58a0ce51 and counts 0 here. A read with one match still counts 1.

Non-blocking, for the description and polish:

  • [P3 nit] The description still says standalone --output output is unchanged; it now reports graphHealth: null when graph-index.json is missing, as documented on WikiLintReport. It also does not yet mention that path-derived edges count.
  • [P3 nit] The new line starts with lowercase graph: not checked; the line next to it reads Graph: ….
  • [P3 nit] src/viz.ts still has the two as casts.

Nothing blocking from our side; CI was still running at this head when this was written.

@jeff-r2026 Your call; this merges after #1636.

@Walternater

Copy link
Copy Markdown
Contributor Author

Friendly nudge @jeff-r2026 — ready from our side pending the stack:

  • All of SaulMoro's findings resolved, and three rounds of Codex review are addressed at 9024c850 (latest pass left two P2s, both fixed: health counts pin to the resolved scope, and the ambiguity pool now includes recalled paths).
  • CI green, MERGEABLE against main (the earlier conflict with fix(codebase): keep wiki lint output in English #1653 was resolved by merging main in).

Merge order: #1636 first, then one final --onto origin/main rebase here (~mechanical, the recall-adoption/viz/lint fixes are independent of it) and this merges cleanly. Happy to do that rebase the moment #1636 lands.

@SaulMoro

SaulMoro commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

#1636 is merged (0af232c). This branch still carries #1636's original commits, and main has since changed src/index.ts and the generated skill-data/core/references/commands.md. Please rebase onto main and run node scripts/check-docs.mjs --write, so CI runs on the real combination. Nothing blocking is open from our side at 9024c85. Once the rebase is green and changes nothing but the rebase, this is ready to merge.

The earlier nits still apply if you want to take them in the same push: the lowercase "graph:" label, the stale part of the description, and the casts in viz.ts.

wcf and others added 9 commits November 2, 2026 16:06
…ent#1562 part 1)

Lint reads the member's own recall indexes — the same scopes recall
selects, never a fresh build — and counts the assets visible there:
resolved relations (once per unordered asset pair, declared beating link,
no 5-line cap), assets without a relation in either direction, and
declared relations whose target names no asset in the team clone on disk
or the learnings roots, the same existence check contribute makes. The
text report gains one line after it; --json gains an assetGraph object.
Without a teamwiki the graph checks are skipped but the asset line still
prints; standalone --output has no member, so no assetGraph at all. The
exit code does not change.
…#1562 part 2)

The /kb-report health view and /api/context now show the Tencent#1562 part-1
relation counts next to the never-recalled list: assets, relations,
without-a-relation, and unresolved declared targets, each listing the
assets behind it by team-tree path, plus the silent ∩ without-relation
intersection. Counts are computed server-side over the report's own
search index, resolving with recall's RelationContext (recall-identical
visibility, withheld teamwiki codebases) and contribute's team-clone /
learnings-roots existence check for unresolved targets; the section
labels the scope it was resolved for like the rest of the view.
…#1562 part 3)

The run line's per-doc entry now records exactly the Related: paths recall
printed for that doc (relation, direction, resolved path), computed once
per result and shared between stdout and the log. teamai stats' recall
section gains a "via relation" column: a run counts once when a countable
read of the session opens any of its recorded related paths within the
adoption window, mirroring the adoption join without touching votes.
Docs without related (any log written before this change) contribute 0,
and opening a related path changes no vote.
The view now calls the same pure counter as codebase --lint, so the two
can never disagree about the counts (Tencent#1562): a relation to a teamwiki
page resolves for recall but does not count, a page being a target, not
an asset. The viz fixture gains the rule's REFERENCES of the learning to
match the issue's acceptance example.
… full JSON shape, pooled ambiguity

Review on Tencent#1637:
- relationCount now includes a relation to a teamwiki page when the page
  exists and its codebase is not withheld — the issue's acceptance
  arithmetic (Tencent#1552's example plus the typo gives 4) holds only this
  way; pages stay out of assetCount and withoutRelation. The fixtures
  now use the true Tencent#1552 example.
- Lint applies declared-beats-link by target, the rule recall renders:
  a local link to an asset that also has a declared relation from the
  same entry is prose, not a second edge.
- --lint --json without a teamwiki prints the full report shape
  (summary, issues, graphHealth, assetGraph) so scripts reading
  .summary see the same structure either way.
- via relation pools every applicable run's related paths before the
  relative-path ambiguity check, the same way adoption pools docs: a
  relative read that could name a path in two runs' roots credits
  neither.
…ount rule, null graphHealth

Review on Tencent#1637:
- recall-adoption: the via-relation pool now keeps every in-window run
  (counted ones included); already-counted runs are skipped only when
  adding. An absolute read of run A's related path credits A, and a later
  relative read naming a path in both A's and B's roots sees both runs
  and credits neither — 1 where the old pool gave 2 (Tencent#1637 review),
  matching how adoption pools docs. Regression test added.
- lint-asset-graph: the counting comment states the reading the
  relationCount follows — one count per relation line recall renders, so
  a declared REFERENCES the target links back to counts twice — with a
  test locking it (Tencent#1637 review).
- codebase-wiki-lint: graphHealth is null when graph-index.json is
  missing or corrupt (and in the no-teamwiki --lint --json fallback),
  so a JSON reader sees "not checked" instead of a measured 0%.
  summary zeros stay: issues were checked, none found.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution
+ viz unit suites pass (192 tests).
…e onto Tencent#1636's page pool

Rebased onto Tencent#1636's collectCodePages pool; SaulMoro's re-check on Tencent#1637:
- codebase-wiki-lint prints the new not-checked line in English
  (AGENTS.md: no Chinese in CLI output).
- WikiLintReport documents that graphHealth can be null in every mode,
  standalone --output included: graph-index.json missing or corrupt means
  "not checked", never a measured 0%; scripts reading
  graphHealth.connectivity must handle null.
- formatResults delegates relation rendering to resultsRelations (which
  owns the derived-edge computation now); two leftovers from the rebase
  removed.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution +
viz + asset-relations (270 tests) and the 5 real-CLI relations-e2e pass.
…er lint's scope inputs

Codex review on Tencent#1637:
- computeLintAssetGraph now counts path-derived rule→page edges: each
  glob judged per codebase over the scope's code-page pool, a declared
  relation from the rule to the page beating the derived one — the same
  visibility and precedence recall renders. A scoped rule lint used to
  list as unrelated no longer does. Pages stay targets, not assets.
- memberScopeGraphs (extracted from lintAssetGraph) gives the viz health
  view the same saved indexes and scope selection codebase --lint uses,
  so the two cannot disagree about inputs (an inherited user scope
  counted twice before). A report without a member scope (--repo, the
  ~/.teamai fallback) still counts its own entries.

Verified: tsc, lint, build clean; lint-asset-graph + viz +
recall-attribution + asset-relations (254 tests) and the 5 real-CLI
relations-e2e pass.
…led paths in the ambiguity check

Codex review on Tencent#1637:
- memberScopeGraphs accepts an already-resolved config and the viz health
  view passes paths.scope: a dashboard requested with project B's
  explicit config no longer shows project A's (cwd-detected) relation
  counts. An explicitly user-scoped config counts as the user scope and
  cannot inherit itself.
- The via-relation ambiguity pool now holds each run's recalled paths
  alongside its related paths: a relative read that could name one of
  each credits nothing — it is plausibly an ordinary read of the
  recalled doc the relation points away from. Regression test added.

Verified: tsc, lint, build clean; recall-attribution + lint-asset-graph
+ viz (223 tests) and the 5 real-CLI relations-e2e pass.
@Walternater
Walternater force-pushed the feat-1562-asset-graph branch from 9024c85 to 63c32aa Compare November 2, 2026 08:09
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

No new findings in the specified diff.

Resolved: Viz passes its resolved config into memberScopeGraphs. Relative-read ambiguity checks include both recalled and related paths and retain already-counted runs. Earlier fixes remain present; revised contracts address the provenance/teamwiki counting and nullable graphHealth concerns.

Testing: The PR description documents sufficient testing, including build and representative real-CLI verification. No missing-testing finding; the deferred full suite is not blocking.

Only the specified diff was read. Nothing from the PR was run, built, or installed.

@Walternater

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 63c32aa7 — #1636's commits drop out, the diff is now only this PR's changes.

The nits: the not-checked line is the lowercase graph:, the description is current, and the viz.ts casts stay out of this diff.

Nothing in the rebase but the rebase. Ready when you are.

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Approving at 63c32aa. All three parts of #1562 are met, within the scope of the #1552 triage:

  • codebase --lint counts the member's asset relations.
  • The knowledge-base health view shows the same counts.
  • stats counts the files a session opens from a relation.

Rebase check: compared with 9024c85, the range-diff shows eight of the nine commits unchanged. The only difference is the resolved conflict with #1653's English output in src/codebase-wiki-lint.ts. In the final tree that file prints only English, keeps the graphHealth === null branch and the asset line, and has no conflict markers. CI is green at this head.

Everything from our earlier rounds is resolved. Remaining nit: the not-checked line still starts with a lowercase graph:, while the measured line says Graph:.

@SaulMoro
SaulMoro merged commit 02b8e9f into Tencent:main Nov 2, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
… full JSON shape, pooled ambiguity

Review on Tencent#1637:
- relationCount now includes a relation to a teamwiki page when the page
  exists and its codebase is not withheld — the issue's acceptance
  arithmetic (Tencent#1552's example plus the typo gives 4) holds only this
  way; pages stay out of assetCount and withoutRelation. The fixtures
  now use the true Tencent#1552 example.
- Lint applies declared-beats-link by target, the rule recall renders:
  a local link to an asset that also has a declared relation from the
  same entry is prose, not a second edge.
- --lint --json without a teamwiki prints the full report shape
  (summary, issues, graphHealth, assetGraph) so scripts reading
  .summary see the same structure either way.
- via relation pools every applicable run's related paths before the
  relative-path ambiguity check, the same way adoption pools docs: a
  relative read that could name a path in two runs' roots credits
  neither.
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…ount rule, null graphHealth

Review on Tencent#1637:
- recall-adoption: the via-relation pool now keeps every in-window run
  (counted ones included); already-counted runs are skipped only when
  adding. An absolute read of run A's related path credits A, and a later
  relative read naming a path in both A's and B's roots sees both runs
  and credits neither — 1 where the old pool gave 2 (Tencent#1637 review),
  matching how adoption pools docs. Regression test added.
- lint-asset-graph: the counting comment states the reading the
  relationCount follows — one count per relation line recall renders, so
  a declared REFERENCES the target links back to counts twice — with a
  test locking it (Tencent#1637 review).
- codebase-wiki-lint: graphHealth is null when graph-index.json is
  missing or corrupt (and in the no-teamwiki --lint --json fallback),
  so a JSON reader sees "not checked" instead of a measured 0%.
  summary zeros stay: issues were checked, none found.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution
+ viz unit suites pass (192 tests).
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…e onto Tencent#1636's page pool

Rebased onto Tencent#1636's collectCodePages pool; SaulMoro's re-check on Tencent#1637:
- codebase-wiki-lint prints the new not-checked line in English
  (AGENTS.md: no Chinese in CLI output).
- WikiLintReport documents that graphHealth can be null in every mode,
  standalone --output included: graph-index.json missing or corrupt means
  "not checked", never a measured 0%; scripts reading
  graphHealth.connectivity must handle null.
- formatResults delegates relation rendering to resultsRelations (which
  owns the derived-edge computation now); two leftovers from the rebase
  removed.

Verified: tsc, lint, build clean; lint-asset-graph + recall-attribution +
viz + asset-relations (270 tests) and the 5 real-CLI relations-e2e pass.
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…er lint's scope inputs

Codex review on Tencent#1637:
- computeLintAssetGraph now counts path-derived rule→page edges: each
  glob judged per codebase over the scope's code-page pool, a declared
  relation from the rule to the page beating the derived one — the same
  visibility and precedence recall renders. A scoped rule lint used to
  list as unrelated no longer does. Pages stay targets, not assets.
- memberScopeGraphs (extracted from lintAssetGraph) gives the viz health
  view the same saved indexes and scope selection codebase --lint uses,
  so the two cannot disagree about inputs (an inherited user scope
  counted twice before). A report without a member scope (--repo, the
  ~/.teamai fallback) still counts its own entries.

Verified: tsc, lint, build clean; lint-asset-graph + viz +
recall-attribution + asset-relations (254 tests) and the 5 real-CLI
relations-e2e pass.
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…led paths in the ambiguity check

Codex review on Tencent#1637:
- memberScopeGraphs accepts an already-resolved config and the viz health
  view passes paths.scope: a dashboard requested with project B's
  explicit config no longer shows project A's (cwd-detected) relation
  counts. An explicitly user-scoped config counts as the user scope and
  cannot inherit itself.
- The via-relation ambiguity pool now holds each run's recalled paths
  alongside its related paths: a relative read that could name one of
  each credits nothing — it is plausibly an ordinary read of the
  recalled doc the relation points away from. Regression test added.

Verified: tsc, lint, build clean; recall-attribution + lint-asset-graph
+ viz (223 tests) and the 5 real-CLI relations-e2e pass.
hz89Dev added a commit to hz89Dev/teamai-cli that referenced this pull request Nov 2, 2026
… for in the relations and read-gates code

`oxlint --fix` with only this rule on, over the files Tencent#1636, Tencent#1637 and
hz89Dev added a commit to hz89Dev/teamai-cli that referenced this pull request Nov 2, 2026
…unchecked casts

From Tencent#1636 and Tencent#1637:
- a code page's `source:` field is parsed with a schema (one path or a
  list, other entries name nothing) instead of typeof;
- readdirSync with an encoding returns string[], and Map iterators
  already type `.next().value`, so their casts go;
- the run line leaves `related` undefined, which the JSONL writer drops,
  instead of spreading an empty object;
- the health view's partial LocalConfig carries a SAFETY note naming the
  fields its readers use.

Proof: tsc and npm run lint pass; the recall, asset-relations and viz
tests pass.
hz89Dev added a commit to hz89Dev/teamai-cli that referenced this pull request Nov 2, 2026
… for in the relations and read-gates code

`oxlint --fix` with only this rule on, over the files Tencent#1636, Tencent#1637 and
hz89Dev added a commit to hz89Dev/teamai-cli that referenced this pull request Nov 2, 2026
…unchecked casts

From Tencent#1636 and Tencent#1637:
- a code page's `source:` field is parsed with a schema (one path or a
  list, other entries name nothing) instead of typeof;
- readdirSync with an encoding returns string[], and Map iterators
  already type `.next().value`, so their casts go;
- the run line leaves `related` undefined, which the JSONL writer drops,
  instead of spreading an empty object;
- the health view's partial LocalConfig carries a SAFETY note naming the
  fields its readers use.

Proof: tsc and npm run lint pass; the recall, asset-relations and viz
tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants